package com.skyline.wo.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.skyline.wo.model.Video;

public class VideoMapper  implements RowMapper<Video> {

private static final VideoMapper MAPPER = new VideoMapper();
	
	public static VideoMapper getMapper() {
		return MAPPER;
	}
	
	@Override
	public Video mapRow(ResultSet rs, int arg1) throws SQLException {
		Video v=new Video();
		v.setCommentNum(rs.getInt("commentNum"));
		v.setCreateTime(rs.getTimestamp("createTime"));
		v.setDown(rs.getInt("down"));
		v.setFlashUrl(rs.getString("flashUrl"));
		v.setHtmlCode(rs.getString("htmlCode"));
		v.setId(rs.getLong("id"));
		v.setOwnerId(rs.getLong("ownerId"));
		v.setOwnerNickname(rs.getString("ownerNickname"));
		v.setOwnerPortrait(rs.getString("ownerPortrait"));
		v.setPageUrl(rs.getString("pageUrl"));
		v.setShareNum(rs.getInt("shareNum"));
		v.setSource(rs.getString("source"));
		v.setSummary(rs.getString("summary"));
		v.setThumbnail(rs.getString("thumbnail"));
		v.setTime(rs.getString("time"));
		v.setTitle(rs.getString("title"));
		v.setUp(rs.getInt("up"));
		//v.setUpdateTime()
		v.setVisitNum(rs.getInt("visitNum"));
		//v.setDigest(rs.getString("digest"));
		return v;
	}

}
